Conversation
|
luoluoyuyu
left a comment
There was a problem hiding this comment.
Review summary
Hardens legacy pipe file transfer: resolveFileInFileDataDir validates file names and resolves paths safely; transportFile uses resolved files for index checks; ClientRPCServiceImpl enforces login and USE_PIPE before handshake, sendPipeData, and sendFile; legacy sink opens a session before transfer.
Recommend merging. Optional IT for malicious file names noted inline.
| + illegalError); | ||
| } | ||
|
|
||
| return PipeReceiverFilePathUtils.resolveFilePath(Paths.get(fileDir), fileName).toFile(); |
There was a problem hiding this comment.
Good fix: PipeReceiverFilePathUtils.resolveFilePath plus illegal-name checks block path traversal in transportFile and handleTsFilePipeData. Consider adding an integration test with a malicious fileName expecting SYNC_FILE_ERROR.
| return getNotLoggedInStatus(); | ||
| } | ||
| return AuthorityChecker.getTSStatus( | ||
| AuthorityChecker.checkSystemPermission(clientSession.getUsername(), PrivilegeType.USE_PIPE), |
There was a problem hiding this comment.
Requiring login and USE_PIPE before legacy pipe RPCs closes unauthenticated file transfer. Document that legacy sinks must call openSession (as done in IoTDBLegacyPipeSink in this PR) when upgrading.



Description
This PR hardens the legacy pipe receiver file-transfer path and aligns its RPC access checks with normal client-
session expectations.
Changes
.., and normalized paths outside the receiverfile-datadirectory.TsFilePipeData.USE_PIPEprivilege for legacyhandshake,sendFile, andsendPipeData.connector behavior.
Tests
mvn '-Ddevelocity.off=true' '-Dscan=false' '-pl' 'iotdb-core/datanode' 'spotless:apply'git diff --checkmvn '-Ddevelocity.off=true' '-Dscan=false' '-pl' 'iotdb-core/datanode' '-Dtest=IoTDBLegacyPipeReceiverAgentTest' 'test'This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR